package com.dhy.service;

import com.dhy.msg.CommonResult;
import com.dhy.pojo.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
//指定当前请求需要发给在注册中心的微服务的名字
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService
{
    //OpenFegin支持SpringMVC相关的RequestMapping注解
    //GetMapping,PostMapping...
    //发送给服务器的请求路径
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);
}

